<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.6"/>
<title>tinydtls: crypto.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">tinydtls
   &#160;<span id="projectnumber">0.8.2</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.6 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>Globals</span></a></li>
    </ul>
  </div>
</div><!-- top -->
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Data Structures</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Macros</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(9)"><span class="SelectionMark">&#160;</span>Groups</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="headertitle">
<div class="title">crypto.h</div>  </div>
</div><!--header-->
<div class="contents">
<a href="crypto_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;<span class="comment">/* dtls -- a very basic DTLS implementation</span></div>
<div class="line"><a name="l00002"></a><span class="lineno">    2</span>&#160;<span class="comment"> *</span></div>
<div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;<span class="comment"> * Copyright (C) 2011--2012 Olaf Bergmann &lt;bergmann@tzi.org&gt;</span></div>
<div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;<span class="comment"> * Copyright (C) 2013 Hauke Mehrtens &lt;hauke@hauke-m.de&gt;</span></div>
<div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;<span class="comment"> *</span></div>
<div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;<span class="comment"> * Permission is hereby granted, free of charge, to any person</span></div>
<div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;<span class="comment"> * obtaining a copy of this software and associated documentation</span></div>
<div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;<span class="comment"> * files (the &quot;Software&quot;), to deal in the Software without</span></div>
<div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;<span class="comment"> * restriction, including without limitation the rights to use, copy,</span></div>
<div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;<span class="comment"> * modify, merge, publish, distribute, sublicense, and/or sell copies</span></div>
<div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;<span class="comment"> * of the Software, and to permit persons to whom the Software is</span></div>
<div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160;<span class="comment"> * furnished to do so, subject to the following conditions:</span></div>
<div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160;<span class="comment"> *</span></div>
<div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160;<span class="comment"> * The above copyright notice and this permission notice shall be</span></div>
<div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160;<span class="comment"> * included in all copies or substantial portions of the Software.</span></div>
<div class="line"><a name="l00016"></a><span class="lineno">   16</span>&#160;<span class="comment"> *</span></div>
<div class="line"><a name="l00017"></a><span class="lineno">   17</span>&#160;<span class="comment"> * THE SOFTWARE IS PROVIDED &quot;AS IS&quot;, WITHOUT WARRANTY OF ANY KIND,</span></div>
<div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160;<span class="comment"> * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF</span></div>
<div class="line"><a name="l00019"></a><span class="lineno">   19</span>&#160;<span class="comment"> * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND</span></div>
<div class="line"><a name="l00020"></a><span class="lineno">   20</span>&#160;<span class="comment"> * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS</span></div>
<div class="line"><a name="l00021"></a><span class="lineno">   21</span>&#160;<span class="comment"> * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN</span></div>
<div class="line"><a name="l00022"></a><span class="lineno">   22</span>&#160;<span class="comment"> * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN</span></div>
<div class="line"><a name="l00023"></a><span class="lineno">   23</span>&#160;<span class="comment"> * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE</span></div>
<div class="line"><a name="l00024"></a><span class="lineno">   24</span>&#160;<span class="comment"> * SOFTWARE.</span></div>
<div class="line"><a name="l00025"></a><span class="lineno">   25</span>&#160;<span class="comment"> */</span></div>
<div class="line"><a name="l00026"></a><span class="lineno">   26</span>&#160;</div>
<div class="line"><a name="l00027"></a><span class="lineno">   27</span>&#160;<span class="preprocessor">#ifndef _DTLS_CRYPTO_H_</span></div>
<div class="line"><a name="l00028"></a><span class="lineno">   28</span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define _DTLS_CRYPTO_H_</span></div>
<div class="line"><a name="l00029"></a><span class="lineno">   29</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00030"></a><span class="lineno">   30</span>&#160;<span class="preprocessor">#include &lt;stdlib.h&gt;</span>     <span class="comment">/* for rand() and srand() */</span></div>
<div class="line"><a name="l00031"></a><span class="lineno">   31</span>&#160;<span class="preprocessor">#include &lt;stdint.h&gt;</span></div>
<div class="line"><a name="l00032"></a><span class="lineno">   32</span>&#160;</div>
<div class="line"><a name="l00033"></a><span class="lineno">   33</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="t__list_8h.html">t_list.h</a>&quot;</span></div>
<div class="line"><a name="l00034"></a><span class="lineno">   34</span>&#160;</div>
<div class="line"><a name="l00035"></a><span class="lineno">   35</span>&#160;<span class="preprocessor">#include &quot;aes/rijndael.h&quot;</span></div>
<div class="line"><a name="l00036"></a><span class="lineno">   36</span>&#160;</div>
<div class="line"><a name="l00037"></a><span class="lineno">   37</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="global_8h.html">global.h</a>&quot;</span></div>
<div class="line"><a name="l00038"></a><span class="lineno">   38</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="state_8h.html">state.h</a>&quot;</span></div>
<div class="line"><a name="l00039"></a><span class="lineno">   39</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="numeric_8h.html">numeric.h</a>&quot;</span></div>
<div class="line"><a name="l00040"></a><span class="lineno">   40</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="hmac_8h.html">hmac.h</a>&quot;</span></div>
<div class="line"><a name="l00041"></a><span class="lineno">   41</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="ccm_8h.html">ccm.h</a>&quot;</span></div>
<div class="line"><a name="l00042"></a><span class="lineno">   42</span>&#160;</div>
<div class="line"><a name="l00043"></a><span class="lineno">   43</span>&#160;<span class="comment">/* TLS_PSK_WITH_AES_128_CCM_8 */</span></div>
<div class="line"><a name="l00044"></a><span class="lineno"><a class="line" href="crypto_8h.html#a5962b0d908f9b15406ca53d27a33e08a">   44</a></span>&#160;<span class="preprocessor">#define DTLS_MAC_KEY_LENGTH    0</span></div>
<div class="line"><a name="l00045"></a><span class="lineno"><a class="line" href="crypto_8h.html#a829b5d5e4d693fdb3de335a0e2017076">   45</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define DTLS_KEY_LENGTH        16 </span><span class="comment">/* AES-128 */</span><span class="preprocessor"></span></div>
<div class="line"><a name="l00046"></a><span class="lineno"><a class="line" href="crypto_8h.html#ae86031f934f3f5f3af42dad5ff8e8757">   46</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define DTLS_BLK_LENGTH        16 </span><span class="comment">/* AES-128 */</span><span class="preprocessor"></span></div>
<div class="line"><a name="l00047"></a><span class="lineno"><a class="line" href="crypto_8h.html#a4fa04874a476a8cc5048372b6d584dbe">   47</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define DTLS_MAC_LENGTH        DTLS_HMAC_DIGEST_SIZE</span></div>
<div class="line"><a name="l00048"></a><span class="lineno"><a class="line" href="crypto_8h.html#a8106002d0d69d8da810321c65ac71385">   48</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define DTLS_IV_LENGTH         4  </span><span class="comment">/* length of nonce_explicit */</span><span class="preprocessor"></span></div>
<div class="line"><a name="l00049"></a><span class="lineno">   49</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00055"></a><span class="lineno"><a class="line" href="crypto_8h.html#a0df6db4f8c29f2b0aa5a1363b4f9127f">   55</a></span>&#160;<span class="preprocessor">#define MAX_KEYBLOCK_LENGTH  \</span></div>
<div class="line"><a name="l00056"></a><span class="lineno">   56</span>&#160;<span class="preprocessor">  (2 * DTLS_MAC_KEY_LENGTH + 2 * DTLS_KEY_LENGTH + 2 * DTLS_IV_LENGTH)</span></div>
<div class="line"><a name="l00057"></a><span class="lineno">   57</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00059"></a><span class="lineno"><a class="line" href="crypto_8h.html#a2648582ddf4c82abc01d8388bd3f15db">   59</a></span>&#160;<span class="preprocessor">#define DTLS_MASTER_SECRET_LENGTH 48</span></div>
<div class="line"><a name="l00060"></a><span class="lineno"><a class="line" href="crypto_8h.html#a5a0bdff7c0889f35601b4935098508a0">   60</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define DTLS_RANDOM_LENGTH 32</span></div>
<div class="line"><a name="l00061"></a><span class="lineno">   61</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00062"></a><span class="lineno"><a class="line" href="crypto_8h.html#a41f1aa1e1380c5f51d9af32c0a53f7b1">   62</a></span>&#160;<span class="keyword">typedef</span> <span class="keyword">enum</span> { <a class="code" href="crypto_8h.html#a41f1aa1e1380c5f51d9af32c0a53f7b1a1832208b0a725185016b59150ff74fc4">AES128</a>=0 </div>
<div class="line"><a name="l00063"></a><span class="lineno">   63</span>&#160;} <a class="code" href="crypto_8h.html#a41f1aa1e1380c5f51d9af32c0a53f7b1">dtls_crypto_alg</a>;</div>
<div class="line"><a name="l00064"></a><span class="lineno">   64</span>&#160;</div>
<div class="line"><a name="l00065"></a><span class="lineno"><a class="line" href="crypto_8h.html#a3710d42871d602387a5147c05bf9f1ef">   65</a></span>&#160;<span class="keyword">typedef</span> <span class="keyword">enum</span> {</div>
<div class="line"><a name="l00066"></a><span class="lineno"><a class="line" href="crypto_8h.html#a3710d42871d602387a5147c05bf9f1efa517a66bf6725327c3240add3537f34ff">   66</a></span>&#160;  <a class="code" href="crypto_8h.html#a3710d42871d602387a5147c05bf9f1efa517a66bf6725327c3240add3537f34ff">DTLS_ECDH_CURVE_SECP256R1</a></div>
<div class="line"><a name="l00067"></a><span class="lineno">   67</span>&#160;} <a class="code" href="crypto_8h.html#a3710d42871d602387a5147c05bf9f1ef">dtls_ecdh_curve</a>;</div>
<div class="line"><a name="l00068"></a><span class="lineno">   68</span>&#160;</div>
<div class="line"><a name="l00070"></a><span class="lineno"><a class="line" href="structaes128__ccm__t.html">   70</a></span>&#160;<span class="keyword">typedef</span> <span class="keyword">struct </span>{</div>
<div class="line"><a name="l00071"></a><span class="lineno"><a class="line" href="structaes128__ccm__t.html#a5bdf410f025e4177ced456059bc8a371">   71</a></span>&#160;  rijndael_ctx <a class="code" href="structaes128__ccm__t.html#a5bdf410f025e4177ced456059bc8a371">ctx</a>;            </div>
<div class="line"><a name="l00072"></a><span class="lineno">   72</span>&#160;} <a class="code" href="structaes128__ccm__t.html">aes128_ccm_t</a>;</div>
<div class="line"><a name="l00073"></a><span class="lineno">   73</span>&#160;</div>
<div class="line"><a name="l00074"></a><span class="lineno"><a class="line" href="structdtls__cipher__context__t.html">   74</a></span>&#160;<span class="keyword">typedef</span> <span class="keyword">struct </span><a class="code" href="structdtls__cipher__context__t.html">dtls_cipher_context_t</a> {</div>
<div class="line"><a name="l00076"></a><span class="lineno"><a class="line" href="structdtls__cipher__context__t.html#a02da63201e2ac7bc508e3bb54c5761dc">   76</a></span>&#160;  <a class="code" href="structaes128__ccm__t.html">aes128_ccm_t</a> <a class="code" href="structdtls__cipher__context__t.html#a02da63201e2ac7bc508e3bb54c5761dc">data</a>;        </div>
<div class="line"><a name="l00077"></a><span class="lineno">   77</span>&#160;} <a class="code" href="crypto_8h.html#a99482a87021e817524d15c33e89e309c">dtls_cipher_context_t</a>;</div>
<div class="line"><a name="l00078"></a><span class="lineno">   78</span>&#160;</div>
<div class="line"><a name="l00079"></a><span class="lineno"><a class="line" href="structdtls__handshake__parameters__ecdsa__t.html">   79</a></span>&#160;<span class="keyword">typedef</span> <span class="keyword">struct </span>{</div>
<div class="line"><a name="l00080"></a><span class="lineno"><a class="line" href="structdtls__handshake__parameters__ecdsa__t.html#aaa5b9eb0a00a615f7910294ed0739b5b">   80</a></span>&#160;  <a class="code" href="global_8h.html#adde6aaee8457bee49c2a92621fe22b79">uint8</a> own_eph_priv[32];</div>
<div class="line"><a name="l00081"></a><span class="lineno"><a class="line" href="structdtls__handshake__parameters__ecdsa__t.html#aa941f98cb3a6dd1dd3c52fb68c37921f">   81</a></span>&#160;  <a class="code" href="global_8h.html#adde6aaee8457bee49c2a92621fe22b79">uint8</a> other_eph_pub_x[32];</div>
<div class="line"><a name="l00082"></a><span class="lineno"><a class="line" href="structdtls__handshake__parameters__ecdsa__t.html#a56047d51afb4a38924db2000af74e83a">   82</a></span>&#160;  <a class="code" href="global_8h.html#adde6aaee8457bee49c2a92621fe22b79">uint8</a> other_eph_pub_y[32];</div>
<div class="line"><a name="l00083"></a><span class="lineno"><a class="line" href="structdtls__handshake__parameters__ecdsa__t.html#a0d0470e6d450f955ef574f22cb74c5bf">   83</a></span>&#160;  <a class="code" href="global_8h.html#adde6aaee8457bee49c2a92621fe22b79">uint8</a> other_pub_x[32];</div>
<div class="line"><a name="l00084"></a><span class="lineno"><a class="line" href="structdtls__handshake__parameters__ecdsa__t.html#af1fde768658a37d6e3a469842e0854b0">   84</a></span>&#160;  <a class="code" href="global_8h.html#adde6aaee8457bee49c2a92621fe22b79">uint8</a> other_pub_y[32];</div>
<div class="line"><a name="l00085"></a><span class="lineno">   85</span>&#160;} <a class="code" href="structdtls__handshake__parameters__ecdsa__t.html">dtls_handshake_parameters_ecdsa_t</a>;</div>
<div class="line"><a name="l00086"></a><span class="lineno">   86</span>&#160;</div>
<div class="line"><a name="l00087"></a><span class="lineno">   87</span>&#160;<span class="comment">/* This is the maximal supported length of the psk client identity and psk</span></div>
<div class="line"><a name="l00088"></a><span class="lineno">   88</span>&#160;<span class="comment"> * server identity hint */</span></div>
<div class="line"><a name="l00089"></a><span class="lineno"><a class="line" href="crypto_8h.html#ab96c8e0773a14d1ce1621eed1a78e2bd">   89</a></span>&#160;<span class="preprocessor">#define DTLS_PSK_MAX_CLIENT_IDENTITY_LEN   32</span></div>
<div class="line"><a name="l00090"></a><span class="lineno">   90</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00091"></a><span class="lineno">   91</span>&#160;<span class="comment">/* This is the maximal supported length of the pre-shared key. */</span></div>
<div class="line"><a name="l00092"></a><span class="lineno"><a class="line" href="crypto_8h.html#a59cd7c0b8724e1f9b910611623396080">   92</a></span>&#160;<span class="preprocessor">#define DTLS_PSK_MAX_KEY_LEN 32</span></div>
<div class="line"><a name="l00093"></a><span class="lineno">   93</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00094"></a><span class="lineno"><a class="line" href="structdtls__handshake__parameters__psk__t.html">   94</a></span>&#160;<span class="keyword">typedef</span> <span class="keyword">struct </span>{</div>
<div class="line"><a name="l00095"></a><span class="lineno"><a class="line" href="structdtls__handshake__parameters__psk__t.html#a39ae0d1ead76e8bd5a3631ae8677be1b">   95</a></span>&#160;  uint16_t <a class="code" href="structdtls__handshake__parameters__psk__t.html#a39ae0d1ead76e8bd5a3631ae8677be1b">id_length</a>;</div>
<div class="line"><a name="l00096"></a><span class="lineno"><a class="line" href="structdtls__handshake__parameters__psk__t.html#a6cce0754e4b9cf5469ddfec595be3084">   96</a></span>&#160;  <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> identity[<a class="code" href="crypto_8h.html#ab96c8e0773a14d1ce1621eed1a78e2bd">DTLS_PSK_MAX_CLIENT_IDENTITY_LEN</a>];</div>
<div class="line"><a name="l00097"></a><span class="lineno">   97</span>&#160;} <a class="code" href="structdtls__handshake__parameters__psk__t.html">dtls_handshake_parameters_psk_t</a>;</div>
<div class="line"><a name="l00098"></a><span class="lineno">   98</span>&#160;</div>
<div class="line"><a name="l00099"></a><span class="lineno"><a class="line" href="structdtls__security__parameters__t.html">   99</a></span>&#160;<span class="keyword">typedef</span> <span class="keyword">struct </span>{</div>
<div class="line"><a name="l00100"></a><span class="lineno"><a class="line" href="structdtls__security__parameters__t.html#a6a72df7ab1151f81e49d464175fcaf2a">  100</a></span>&#160;  <a class="code" href="global_8h.html#a1ff555e0b1443c4cb4d17ac2161d89b2">dtls_compression_t</a> <a class="code" href="structdtls__security__parameters__t.html#a6a72df7ab1151f81e49d464175fcaf2a">compression</a>;   </div>
<div class="line"><a name="l00102"></a><span class="lineno"><a class="line" href="structdtls__security__parameters__t.html#a21d9fac709d739535b0cbecce4c18830">  102</a></span>&#160;  <a class="code" href="global_8h.html#ada7e71454d685b693df45b2c1ea0c59b">dtls_cipher_t</a> <a class="code" href="structdtls__security__parameters__t.html#a21d9fac709d739535b0cbecce4c18830">cipher</a>;     </div>
<div class="line"><a name="l00103"></a><span class="lineno"><a class="line" href="structdtls__security__parameters__t.html#a2bce1fa0bf77eeab8fadca824de602da">  103</a></span>&#160;  uint16_t <a class="code" href="structdtls__security__parameters__t.html#a2bce1fa0bf77eeab8fadca824de602da">epoch</a>;        </div>
<div class="line"><a name="l00104"></a><span class="lineno"><a class="line" href="structdtls__security__parameters__t.html#a100dc82ee41004df1d9f211873332f87">  104</a></span>&#160;  uint64_t <a class="code" href="structdtls__security__parameters__t.html#a100dc82ee41004df1d9f211873332f87">rseq</a>;         </div>
<div class="line"><a name="l00112"></a><span class="lineno"><a class="line" href="structdtls__security__parameters__t.html#a1c3a56ea4af8ff71e1ffe77221541f4d">  112</a></span>&#160;  <a class="code" href="global_8h.html#adde6aaee8457bee49c2a92621fe22b79">uint8</a> key_block[<a class="code" href="crypto_8h.html#a0df6db4f8c29f2b0aa5a1363b4f9127f">MAX_KEYBLOCK_LENGTH</a>];</div>
<div class="line"><a name="l00113"></a><span class="lineno">  113</span>&#160;} <a class="code" href="structdtls__security__parameters__t.html">dtls_security_parameters_t</a>;</div>
<div class="line"><a name="l00114"></a><span class="lineno">  114</span>&#160;</div>
<div class="line"><a name="l00115"></a><span class="lineno"><a class="line" href="structdtls__handshake__parameters__t.html">  115</a></span>&#160;<span class="keyword">typedef</span> <span class="keyword">struct </span>{</div>
<div class="line"><a name="l00116"></a><span class="lineno">  116</span>&#160;  <span class="keyword">union </span>{</div>
<div class="line"><a name="l00117"></a><span class="lineno">  117</span>&#160;    <span class="keyword">struct </span>random_t {</div>
<div class="line"><a name="l00118"></a><span class="lineno"><a class="line" href="structdtls__handshake__parameters__t.html#af37f38ce7c5f5e4ab62f16aacc2035f9">  118</a></span>&#160;      <a class="code" href="global_8h.html#adde6aaee8457bee49c2a92621fe22b79">uint8</a> client[<a class="code" href="crypto_8h.html#a5a0bdff7c0889f35601b4935098508a0">DTLS_RANDOM_LENGTH</a>]; </div>
<div class="line"><a name="l00119"></a><span class="lineno"><a class="line" href="structdtls__handshake__parameters__t.html#a17344d2dab22a9c2c7f8bc9ef9137036">  119</a></span>&#160;      <a class="code" href="global_8h.html#adde6aaee8457bee49c2a92621fe22b79">uint8</a> server[<a class="code" href="crypto_8h.html#a5a0bdff7c0889f35601b4935098508a0">DTLS_RANDOM_LENGTH</a>]; </div>
<div class="line"><a name="l00120"></a><span class="lineno">  120</span>&#160;    } random;</div>
<div class="line"><a name="l00122"></a><span class="lineno"><a class="line" href="structdtls__handshake__parameters__t.html#a21ba88c7b062772beb75c5570d257898">  122</a></span>&#160;    <a class="code" href="global_8h.html#adde6aaee8457bee49c2a92621fe22b79">uint8</a> master_secret[<a class="code" href="crypto_8h.html#a2648582ddf4c82abc01d8388bd3f15db">DTLS_MASTER_SECRET_LENGTH</a>];</div>
<div class="line"><a name="l00123"></a><span class="lineno">  123</span>&#160;  } tmp;</div>
<div class="line"><a name="l00124"></a><span class="lineno">  124</span>&#160;  <a class="code" href="t__list_8h.html#ab5acb500a887e1957292f3dddc5c9b79">LIST_STRUCT</a>(reorder_queue);   </div>
<div class="line"><a name="l00125"></a><span class="lineno"><a class="line" href="structdtls__handshake__parameters__t.html#a56e7392a649731166fc82a523b0eb027">  125</a></span>&#160;  <a class="code" href="structdtls__hs__state__t.html">dtls_hs_state_t</a> <a class="code" href="structdtls__handshake__parameters__t.html#a56e7392a649731166fc82a523b0eb027">hs_state</a>;  </div>
<div class="line"><a name="l00127"></a><span class="lineno"><a class="line" href="structdtls__handshake__parameters__t.html#a67f85371953c8ae07ec110cb39c13125">  127</a></span>&#160;  <a class="code" href="global_8h.html#a1ff555e0b1443c4cb4d17ac2161d89b2">dtls_compression_t</a> <a class="code" href="structdtls__handshake__parameters__t.html#a67f85371953c8ae07ec110cb39c13125">compression</a>;       </div>
<div class="line"><a name="l00128"></a><span class="lineno"><a class="line" href="structdtls__handshake__parameters__t.html#a5cc61a98763800b5b4e7617307649933">  128</a></span>&#160;  <a class="code" href="global_8h.html#ada7e71454d685b693df45b2c1ea0c59b">dtls_cipher_t</a> <a class="code" href="structdtls__handshake__parameters__t.html#a5cc61a98763800b5b4e7617307649933">cipher</a>;     </div>
<div class="line"><a name="l00129"></a><span class="lineno"><a class="line" href="structdtls__handshake__parameters__t.html#ab17efe8550600d945ced029e43ca86d6">  129</a></span>&#160;  <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> do_client_auth:1;</div>
<div class="line"><a name="l00130"></a><span class="lineno">  130</span>&#160;  <span class="keyword">union </span>{</div>
<div class="line"><a name="l00131"></a><span class="lineno">  131</span>&#160;<span class="preprocessor">#ifdef DTLS_ECC</span></div>
<div class="line"><a name="l00132"></a><span class="lineno">  132</span>&#160;<span class="preprocessor"></span>    <a class="code" href="structdtls__handshake__parameters__ecdsa__t.html">dtls_handshake_parameters_ecdsa_t</a> ecdsa;</div>
<div class="line"><a name="l00133"></a><span class="lineno">  133</span>&#160;<span class="preprocessor">#endif </span><span class="comment">/* DTLS_ECC */</span><span class="preprocessor"></span></div>
<div class="line"><a name="l00134"></a><span class="lineno">  134</span>&#160;<span class="preprocessor"></span><span class="preprocessor">#ifdef DTLS_PSK</span></div>
<div class="line"><a name="l00135"></a><span class="lineno">  135</span>&#160;<span class="preprocessor"></span>    <a class="code" href="structdtls__handshake__parameters__psk__t.html">dtls_handshake_parameters_psk_t</a> psk;</div>
<div class="line"><a name="l00136"></a><span class="lineno">  136</span>&#160;<span class="preprocessor">#endif </span><span class="comment">/* DTLS_PSK */</span><span class="preprocessor"></span></div>
<div class="line"><a name="l00137"></a><span class="lineno">  137</span>&#160;<span class="preprocessor"></span>  } keyx;</div>
<div class="line"><a name="l00138"></a><span class="lineno">  138</span>&#160;} <a class="code" href="structdtls__handshake__parameters__t.html">dtls_handshake_parameters_t</a>;</div>
<div class="line"><a name="l00139"></a><span class="lineno">  139</span>&#160;</div>
<div class="line"><a name="l00140"></a><span class="lineno">  140</span>&#160;<span class="comment">/* The following macros provide access to the components of the</span></div>
<div class="line"><a name="l00141"></a><span class="lineno">  141</span>&#160;<span class="comment"> * key_block in the security parameters. */</span></div>
<div class="line"><a name="l00142"></a><span class="lineno">  142</span>&#160;</div>
<div class="line"><a name="l00143"></a><span class="lineno"><a class="line" href="crypto_8h.html#a72899232c09d09b86326c6f234addc02">  143</a></span>&#160;<span class="preprocessor">#define dtls_kb_client_mac_secret(Param, Role) ((Param)-&gt;key_block)</span></div>
<div class="line"><a name="l00144"></a><span class="lineno"><a class="line" href="crypto_8h.html#ac8fdf3770dcd956ca10d1044a57a7a3a">  144</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define dtls_kb_server_mac_secret(Param, Role)              \</span></div>
<div class="line"><a name="l00145"></a><span class="lineno">  145</span>&#160;<span class="preprocessor">  (dtls_kb_client_mac_secret(Param, Role) + DTLS_MAC_KEY_LENGTH)</span></div>
<div class="line"><a name="l00146"></a><span class="lineno"><a class="line" href="crypto_8h.html#acf318c989f5bb90b863154abbc408b66">  146</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define dtls_kb_remote_mac_secret(Param, Role)              \</span></div>
<div class="line"><a name="l00147"></a><span class="lineno">  147</span>&#160;<span class="preprocessor">  ((Role) == DTLS_SERVER                        \</span></div>
<div class="line"><a name="l00148"></a><span class="lineno">  148</span>&#160;<span class="preprocessor">   ? dtls_kb_client_mac_secret(Param, Role)             \</span></div>
<div class="line"><a name="l00149"></a><span class="lineno">  149</span>&#160;<span class="preprocessor">   : dtls_kb_server_mac_secret(Param, Role))</span></div>
<div class="line"><a name="l00150"></a><span class="lineno"><a class="line" href="crypto_8h.html#aa60519b0e9b775ccb0bdb46762f43418">  150</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define dtls_kb_local_mac_secret(Param, Role)               \</span></div>
<div class="line"><a name="l00151"></a><span class="lineno">  151</span>&#160;<span class="preprocessor">  ((Role) == DTLS_CLIENT                        \</span></div>
<div class="line"><a name="l00152"></a><span class="lineno">  152</span>&#160;<span class="preprocessor">   ? dtls_kb_client_mac_secret(Param, Role)             \</span></div>
<div class="line"><a name="l00153"></a><span class="lineno">  153</span>&#160;<span class="preprocessor">   : dtls_kb_server_mac_secret(Param, Role))</span></div>
<div class="line"><a name="l00154"></a><span class="lineno"><a class="line" href="crypto_8h.html#a1f320854c9f4e9b2105649b3624976b0">  154</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define dtls_kb_mac_secret_size(Param, Role) DTLS_MAC_KEY_LENGTH</span></div>
<div class="line"><a name="l00155"></a><span class="lineno"><a class="line" href="crypto_8h.html#ab5659b0737d72a2fa1b1335952f9c305">  155</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define dtls_kb_client_write_key(Param, Role)               \</span></div>
<div class="line"><a name="l00156"></a><span class="lineno">  156</span>&#160;<span class="preprocessor">  (dtls_kb_server_mac_secret(Param, Role) + DTLS_MAC_KEY_LENGTH)</span></div>
<div class="line"><a name="l00157"></a><span class="lineno"><a class="line" href="crypto_8h.html#aea906786dcfa12acb320df731c8db7f6">  157</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define dtls_kb_server_write_key(Param, Role)               \</span></div>
<div class="line"><a name="l00158"></a><span class="lineno">  158</span>&#160;<span class="preprocessor">  (dtls_kb_client_write_key(Param, Role) + DTLS_KEY_LENGTH)</span></div>
<div class="line"><a name="l00159"></a><span class="lineno"><a class="line" href="crypto_8h.html#addc8fcbbdd80ba924d0ded2a6bae97f4">  159</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define dtls_kb_remote_write_key(Param, Role)               \</span></div>
<div class="line"><a name="l00160"></a><span class="lineno">  160</span>&#160;<span class="preprocessor">  ((Role) == DTLS_SERVER                        \</span></div>
<div class="line"><a name="l00161"></a><span class="lineno">  161</span>&#160;<span class="preprocessor">   ? dtls_kb_client_write_key(Param, Role)              \</span></div>
<div class="line"><a name="l00162"></a><span class="lineno">  162</span>&#160;<span class="preprocessor">   : dtls_kb_server_write_key(Param, Role))</span></div>
<div class="line"><a name="l00163"></a><span class="lineno"><a class="line" href="crypto_8h.html#a7c9e39188a2e50eb942ce8c7cd8add36">  163</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define dtls_kb_local_write_key(Param, Role)                \</span></div>
<div class="line"><a name="l00164"></a><span class="lineno">  164</span>&#160;<span class="preprocessor">  ((Role) == DTLS_CLIENT                        \</span></div>
<div class="line"><a name="l00165"></a><span class="lineno">  165</span>&#160;<span class="preprocessor">   ? dtls_kb_client_write_key(Param, Role)              \</span></div>
<div class="line"><a name="l00166"></a><span class="lineno">  166</span>&#160;<span class="preprocessor">   : dtls_kb_server_write_key(Param, Role))</span></div>
<div class="line"><a name="l00167"></a><span class="lineno"><a class="line" href="crypto_8h.html#a726ef8efa2e072c3c5e1ea1019e716aa">  167</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define dtls_kb_key_size(Param, Role) DTLS_KEY_LENGTH</span></div>
<div class="line"><a name="l00168"></a><span class="lineno"><a class="line" href="crypto_8h.html#a1d3c04e5d39477a525b5255ab3240094">  168</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define dtls_kb_client_iv(Param, Role)                  \</span></div>
<div class="line"><a name="l00169"></a><span class="lineno">  169</span>&#160;<span class="preprocessor">  (dtls_kb_server_write_key(Param, Role) + DTLS_KEY_LENGTH)</span></div>
<div class="line"><a name="l00170"></a><span class="lineno"><a class="line" href="crypto_8h.html#acdd95c24ec6aebf14dac6ee4386a79be">  170</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define dtls_kb_server_iv(Param, Role)                  \</span></div>
<div class="line"><a name="l00171"></a><span class="lineno">  171</span>&#160;<span class="preprocessor">  (dtls_kb_client_iv(Param, Role) + DTLS_IV_LENGTH)</span></div>
<div class="line"><a name="l00172"></a><span class="lineno"><a class="line" href="crypto_8h.html#a7119d3239c34d7e7f219200792339541">  172</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define dtls_kb_remote_iv(Param, Role)                  \</span></div>
<div class="line"><a name="l00173"></a><span class="lineno">  173</span>&#160;<span class="preprocessor">  ((Role) == DTLS_SERVER                        \</span></div>
<div class="line"><a name="l00174"></a><span class="lineno">  174</span>&#160;<span class="preprocessor">   ? dtls_kb_client_iv(Param, Role)                 \</span></div>
<div class="line"><a name="l00175"></a><span class="lineno">  175</span>&#160;<span class="preprocessor">   : dtls_kb_server_iv(Param, Role))</span></div>
<div class="line"><a name="l00176"></a><span class="lineno"><a class="line" href="crypto_8h.html#ae23208578ac21350cb5915d11da0a2e3">  176</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define dtls_kb_local_iv(Param, Role)                   \</span></div>
<div class="line"><a name="l00177"></a><span class="lineno">  177</span>&#160;<span class="preprocessor">  ((Role) == DTLS_CLIENT                        \</span></div>
<div class="line"><a name="l00178"></a><span class="lineno">  178</span>&#160;<span class="preprocessor">   ? dtls_kb_client_iv(Param, Role)                 \</span></div>
<div class="line"><a name="l00179"></a><span class="lineno">  179</span>&#160;<span class="preprocessor">   : dtls_kb_server_iv(Param, Role))</span></div>
<div class="line"><a name="l00180"></a><span class="lineno"><a class="line" href="crypto_8h.html#adcdadf1870e2acb2993b1a8726d26997">  180</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define dtls_kb_iv_size(Param, Role) DTLS_IV_LENGTH</span></div>
<div class="line"><a name="l00181"></a><span class="lineno">  181</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00182"></a><span class="lineno"><a class="line" href="crypto_8h.html#a147bfdc558c2ec69ffdf388ae19ae01c">  182</a></span>&#160;<span class="preprocessor">#define dtls_kb_size(Param, Role)                   \</span></div>
<div class="line"><a name="l00183"></a><span class="lineno">  183</span>&#160;<span class="preprocessor">  (2 * (dtls_kb_mac_secret_size(Param, Role) +              \</span></div>
<div class="line"><a name="l00184"></a><span class="lineno">  184</span>&#160;<span class="preprocessor">    dtls_kb_key_size(Param, Role) + dtls_kb_iv_size(Param, Role)))</span></div>
<div class="line"><a name="l00185"></a><span class="lineno">  185</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00186"></a><span class="lineno">  186</span>&#160;<span class="comment">/* just for consistency */</span></div>
<div class="line"><a name="l00187"></a><span class="lineno"><a class="line" href="crypto_8h.html#a5c3cbd4d9e514757deda211e97c9c758">  187</a></span>&#160;<span class="preprocessor">#define dtls_kb_digest_size(Param, Role) DTLS_MAC_LENGTH</span></div>
<div class="line"><a name="l00188"></a><span class="lineno">  188</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00205"></a><span class="lineno">  205</span>&#160;<span class="keywordtype">size_t</span> <a class="code" href="crypto_8h.html#aea7bd0a10cf289c033216a97c0ee701e">dtls_p_hash</a>(<a class="code" href="group__HMAC.html#ga698cfa036e69361a93dcdd9b19579b23">dtls_hashfunc_t</a> h, </div>
<div class="line"><a name="l00206"></a><span class="lineno">  206</span>&#160;           <span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> *key, <span class="keywordtype">size_t</span> keylen,</div>
<div class="line"><a name="l00207"></a><span class="lineno">  207</span>&#160;           <span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> *label, <span class="keywordtype">size_t</span> labellen,</div>
<div class="line"><a name="l00208"></a><span class="lineno">  208</span>&#160;           <span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> *random1, <span class="keywordtype">size_t</span> random1len,</div>
<div class="line"><a name="l00209"></a><span class="lineno">  209</span>&#160;           <span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> *random2, <span class="keywordtype">size_t</span> random2len,</div>
<div class="line"><a name="l00210"></a><span class="lineno">  210</span>&#160;           <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> *buf, <span class="keywordtype">size_t</span> buflen);</div>
<div class="line"><a name="l00211"></a><span class="lineno">  211</span>&#160;</div>
<div class="line"><a name="l00217"></a><span class="lineno">  217</span>&#160;<span class="keywordtype">size_t</span> <a class="code" href="crypto_8h.html#a5e47576e502b5a6255f1b489a4915512">dtls_prf</a>(<span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> *key, <span class="keywordtype">size_t</span> keylen,</div>
<div class="line"><a name="l00218"></a><span class="lineno">  218</span>&#160;        <span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> *label, <span class="keywordtype">size_t</span> labellen,</div>
<div class="line"><a name="l00219"></a><span class="lineno">  219</span>&#160;        <span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> *random1, <span class="keywordtype">size_t</span> random1len,</div>
<div class="line"><a name="l00220"></a><span class="lineno">  220</span>&#160;        <span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> *random2, <span class="keywordtype">size_t</span> random2len,</div>
<div class="line"><a name="l00221"></a><span class="lineno">  221</span>&#160;        <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> *buf, <span class="keywordtype">size_t</span> buflen);</div>
<div class="line"><a name="l00222"></a><span class="lineno">  222</span>&#160;</div>
<div class="line"><a name="l00239"></a><span class="lineno">  239</span>&#160;<span class="keywordtype">void</span> <a class="code" href="crypto_8h.html#a1423f8111df1533241178461c10b50e3">dtls_mac</a>(<a class="code" href="structdtls__hmac__context__t.html">dtls_hmac_context_t</a> *hmac_ctx, </div>
<div class="line"><a name="l00240"></a><span class="lineno">  240</span>&#160;          <span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> *record,</div>
<div class="line"><a name="l00241"></a><span class="lineno">  241</span>&#160;          <span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> *packet, <span class="keywordtype">size_t</span> length,</div>
<div class="line"><a name="l00242"></a><span class="lineno">  242</span>&#160;          <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> *buf);</div>
<div class="line"><a name="l00243"></a><span class="lineno">  243</span>&#160;</div>
<div class="line"><a name="l00264"></a><span class="lineno">  264</span>&#160;<span class="keywordtype">int</span> <a class="code" href="crypto_8h.html#a288c4ec1a5110ab3f44ab3cb7c289e69">dtls_encrypt</a>(<span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> *src, <span class="keywordtype">size_t</span> length,</div>
<div class="line"><a name="l00265"></a><span class="lineno">  265</span>&#160;         <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> *buf,</div>
<div class="line"><a name="l00266"></a><span class="lineno">  266</span>&#160;         <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> *nounce,</div>
<div class="line"><a name="l00267"></a><span class="lineno">  267</span>&#160;         <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> *key, <span class="keywordtype">size_t</span> keylen,</div>
<div class="line"><a name="l00268"></a><span class="lineno">  268</span>&#160;         <span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> *aad, <span class="keywordtype">size_t</span> aad_length);</div>
<div class="line"><a name="l00269"></a><span class="lineno">  269</span>&#160;</div>
<div class="line"><a name="l00288"></a><span class="lineno">  288</span>&#160;<span class="keywordtype">int</span> <a class="code" href="crypto_8h.html#a3a99a8753c2eb9baf1e03fe0ffbb813b">dtls_decrypt</a>(<span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> *src, <span class="keywordtype">size_t</span> length,</div>
<div class="line"><a name="l00289"></a><span class="lineno">  289</span>&#160;         <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> *buf,</div>
<div class="line"><a name="l00290"></a><span class="lineno">  290</span>&#160;         <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> *nounce,</div>
<div class="line"><a name="l00291"></a><span class="lineno">  291</span>&#160;         <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> *key, <span class="keywordtype">size_t</span> keylen,</div>
<div class="line"><a name="l00292"></a><span class="lineno">  292</span>&#160;         <span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> *a_data, <span class="keywordtype">size_t</span> a_data_length);</div>
<div class="line"><a name="l00293"></a><span class="lineno">  293</span>&#160;</div>
<div class="line"><a name="l00294"></a><span class="lineno">  294</span>&#160;<span class="comment">/* helper functions */</span></div>
<div class="line"><a name="l00295"></a><span class="lineno">  295</span>&#160;</div>
<div class="line"><a name="l00306"></a><span class="lineno">  306</span>&#160;<span class="keywordtype">int</span> <a class="code" href="crypto_8h.html#aa53dfed4868e257d2485024b5c170bae">dtls_psk_pre_master_secret</a>(<span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> *key, <span class="keywordtype">size_t</span> keylen,</div>
<div class="line"><a name="l00307"></a><span class="lineno">  307</span>&#160;                   <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> *result, <span class="keywordtype">size_t</span> result_len);</div>
<div class="line"><a name="l00308"></a><span class="lineno">  308</span>&#160;</div>
<div class="line"><a name="l00309"></a><span class="lineno"><a class="line" href="crypto_8h.html#a9b039263057e157e1427c5d316133c3d">  309</a></span>&#160;<span class="preprocessor">#define DTLS_EC_KEY_SIZE 32</span></div>
<div class="line"><a name="l00310"></a><span class="lineno">  310</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00311"></a><span class="lineno">  311</span>&#160;<span class="keywordtype">int</span> <a class="code" href="crypto_8h.html#a5f9937088ea2e1d19e7d472fecae9aaa">dtls_ecdh_pre_master_secret</a>(<span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> *priv_key,</div>
<div class="line"><a name="l00312"></a><span class="lineno">  312</span>&#160;                <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> *pub_key_x,</div>
<div class="line"><a name="l00313"></a><span class="lineno">  313</span>&#160;                                <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> *pub_key_y,</div>
<div class="line"><a name="l00314"></a><span class="lineno">  314</span>&#160;                                <span class="keywordtype">size_t</span> key_size,</div>
<div class="line"><a name="l00315"></a><span class="lineno">  315</span>&#160;                                <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> *result,</div>
<div class="line"><a name="l00316"></a><span class="lineno">  316</span>&#160;                                <span class="keywordtype">size_t</span> result_len);</div>
<div class="line"><a name="l00317"></a><span class="lineno">  317</span>&#160;</div>
<div class="line"><a name="l00318"></a><span class="lineno">  318</span>&#160;<span class="keywordtype">void</span> <a class="code" href="crypto_8h.html#a982fc9e78cd10d9323756b15b72c7970">dtls_ecdsa_generate_key</a>(<span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> *priv_key,</div>
<div class="line"><a name="l00319"></a><span class="lineno">  319</span>&#160;                 <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> *pub_key_x,</div>
<div class="line"><a name="l00320"></a><span class="lineno">  320</span>&#160;                 <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> *pub_key_y,</div>
<div class="line"><a name="l00321"></a><span class="lineno">  321</span>&#160;                 <span class="keywordtype">size_t</span> key_size);</div>
<div class="line"><a name="l00322"></a><span class="lineno">  322</span>&#160;</div>
<div class="line"><a name="l00323"></a><span class="lineno">  323</span>&#160;<span class="keywordtype">void</span> <a class="code" href="crypto_8h.html#a49f03039780664684d110d83a228b163">dtls_ecdsa_create_sig_hash</a>(<span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> *priv_key, <span class="keywordtype">size_t</span> key_size,</div>
<div class="line"><a name="l00324"></a><span class="lineno">  324</span>&#160;                <span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> *sign_hash, <span class="keywordtype">size_t</span> sign_hash_size,</div>
<div class="line"><a name="l00325"></a><span class="lineno">  325</span>&#160;                uint32_t point_r[9], uint32_t point_s[9]);</div>
<div class="line"><a name="l00326"></a><span class="lineno">  326</span>&#160;</div>
<div class="line"><a name="l00327"></a><span class="lineno">  327</span>&#160;<span class="keywordtype">void</span> <a class="code" href="crypto_8h.html#afa2d9b2a195a1d8e8c56b1af8cb7bc82">dtls_ecdsa_create_sig</a>(<span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> *priv_key, <span class="keywordtype">size_t</span> key_size,</div>
<div class="line"><a name="l00328"></a><span class="lineno">  328</span>&#160;               <span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> *client_random, <span class="keywordtype">size_t</span> client_random_size,</div>
<div class="line"><a name="l00329"></a><span class="lineno">  329</span>&#160;               <span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> *server_random, <span class="keywordtype">size_t</span> server_random_size,</div>
<div class="line"><a name="l00330"></a><span class="lineno">  330</span>&#160;               <span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> *keyx_params, <span class="keywordtype">size_t</span> keyx_params_size,</div>
<div class="line"><a name="l00331"></a><span class="lineno">  331</span>&#160;               uint32_t point_r[9], uint32_t point_s[9]);</div>
<div class="line"><a name="l00332"></a><span class="lineno">  332</span>&#160;</div>
<div class="line"><a name="l00333"></a><span class="lineno">  333</span>&#160;<span class="keywordtype">int</span> <a class="code" href="crypto_8h.html#a802b3a2b267747a76d4557c6c9a899d7">dtls_ecdsa_verify_sig_hash</a>(<span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> *pub_key_x,</div>
<div class="line"><a name="l00334"></a><span class="lineno">  334</span>&#160;                   <span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> *pub_key_y, <span class="keywordtype">size_t</span> key_size,</div>
<div class="line"><a name="l00335"></a><span class="lineno">  335</span>&#160;                   <span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> *sign_hash, <span class="keywordtype">size_t</span> sign_hash_size,</div>
<div class="line"><a name="l00336"></a><span class="lineno">  336</span>&#160;                   <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> *result_r, <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> *result_s);</div>
<div class="line"><a name="l00337"></a><span class="lineno">  337</span>&#160;</div>
<div class="line"><a name="l00338"></a><span class="lineno">  338</span>&#160;<span class="keywordtype">int</span> <a class="code" href="crypto_8h.html#a035860da45ba2586a95c8ef7f539a3c9">dtls_ecdsa_verify_sig</a>(<span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> *pub_key_x,</div>
<div class="line"><a name="l00339"></a><span class="lineno">  339</span>&#160;              <span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> *pub_key_y, <span class="keywordtype">size_t</span> key_size,</div>
<div class="line"><a name="l00340"></a><span class="lineno">  340</span>&#160;              <span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> *client_random, <span class="keywordtype">size_t</span> client_random_size,</div>
<div class="line"><a name="l00341"></a><span class="lineno">  341</span>&#160;              <span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> *server_random, <span class="keywordtype">size_t</span> server_random_size,</div>
<div class="line"><a name="l00342"></a><span class="lineno">  342</span>&#160;              <span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> *keyx_params, <span class="keywordtype">size_t</span> keyx_params_size,</div>
<div class="line"><a name="l00343"></a><span class="lineno">  343</span>&#160;              <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> *result_r, <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> *result_s);</div>
<div class="line"><a name="l00344"></a><span class="lineno">  344</span>&#160;</div>
<div class="line"><a name="l00345"></a><span class="lineno">  345</span>&#160;<span class="keywordtype">int</span> <a class="code" href="crypto_8h.html#a5ae24f3621f545752732e318840d7e2b">dtls_ec_key_from_uint32_asn1</a>(<span class="keyword">const</span> uint32_t *key, <span class="keywordtype">size_t</span> key_size,</div>
<div class="line"><a name="l00346"></a><span class="lineno">  346</span>&#160;                 <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> *buf);</div>
<div class="line"><a name="l00347"></a><span class="lineno">  347</span>&#160;</div>
<div class="line"><a name="l00348"></a><span class="lineno">  348</span>&#160;</div>
<div class="line"><a name="l00349"></a><span class="lineno">  349</span>&#160;<a class="code" href="structdtls__handshake__parameters__t.html">dtls_handshake_parameters_t</a> *<a class="code" href="crypto_8h.html#a25930cdb27a6ffcf05e2c2a9c95a6af8">dtls_handshake_new</a>();</div>
<div class="line"><a name="l00350"></a><span class="lineno">  350</span>&#160;</div>
<div class="line"><a name="l00351"></a><span class="lineno">  351</span>&#160;<span class="keywordtype">void</span> <a class="code" href="crypto_8h.html#aa17bcdc666796e52788f82ee003bb172">dtls_handshake_free</a>(<a class="code" href="structdtls__handshake__parameters__t.html">dtls_handshake_parameters_t</a> *handshake);</div>
<div class="line"><a name="l00352"></a><span class="lineno">  352</span>&#160;</div>
<div class="line"><a name="l00353"></a><span class="lineno">  353</span>&#160;<a class="code" href="structdtls__security__parameters__t.html">dtls_security_parameters_t</a> *<a class="code" href="crypto_8h.html#a1d568085636a04b4706b7e50df802a7b">dtls_security_new</a>();</div>
<div class="line"><a name="l00354"></a><span class="lineno">  354</span>&#160;</div>
<div class="line"><a name="l00355"></a><span class="lineno">  355</span>&#160;<span class="keywordtype">void</span> <a class="code" href="crypto_8h.html#ad54069f2880b3c07185ebba736d02d17">dtls_security_free</a>(<a class="code" href="structdtls__security__parameters__t.html">dtls_security_parameters_t</a> *security);</div>
<div class="line"><a name="l00356"></a><span class="lineno">  356</span>&#160;<span class="keywordtype">void</span> <a class="code" href="crypto_8h.html#a86e6ce9d4b4afcef355836955697f52c">crypto_init</a>();</div>
<div class="line"><a name="l00357"></a><span class="lineno">  357</span>&#160;</div>
<div class="line"><a name="l00358"></a><span class="lineno">  358</span>&#160;<span class="preprocessor">#endif </span><span class="comment">/* _DTLS_CRYPTO_H_ */</span><span class="preprocessor"></span></div>
<div class="line"><a name="l00359"></a><span class="lineno">  359</span>&#160;<span class="preprocessor"></span></div>
<div class="ttc" id="crypto_8h_html_a5f9937088ea2e1d19e7d472fecae9aaa"><div class="ttname"><a href="crypto_8h.html#a5f9937088ea2e1d19e7d472fecae9aaa">dtls_ecdh_pre_master_secret</a></div><div class="ttdeci">int dtls_ecdh_pre_master_secret(unsigned char *priv_key, unsigned char *pub_key_x, unsigned char *pub_key_y, size_t key_size, unsigned char *result, size_t result_len)</div><div class="ttdef"><b>Definition:</b> <a href="crypto_8c_source.html#l00398">crypto.c:398</a></div></div>
<div class="ttc" id="structaes128__ccm__t_html"><div class="ttname"><a href="structaes128__ccm__t.html">aes128_ccm_t</a></div><div class="ttdef"><b>Definition:</b> <a href="crypto_8h_source.html#l00070">crypto.h:70</a></div></div>
<div class="ttc" id="structdtls__handshake__parameters__t_html_a56e7392a649731166fc82a523b0eb027"><div class="ttname"><a href="structdtls__handshake__parameters__t.html#a56e7392a649731166fc82a523b0eb027">dtls_handshake_parameters_t::hs_state</a></div><div class="ttdeci">dtls_hs_state_t hs_state</div><div class="ttdef"><b>Definition:</b> <a href="crypto_8h_source.html#l00125">crypto.h:125</a></div></div>
<div class="ttc" id="crypto_8h_html_ad54069f2880b3c07185ebba736d02d17"><div class="ttname"><a href="crypto_8h.html#ad54069f2880b3c07185ebba736d02d17">dtls_security_free</a></div><div class="ttdeci">void dtls_security_free(dtls_security_parameters_t *security)</div><div class="ttdef"><b>Definition:</b> <a href="crypto_8c_source.html#l00174">crypto.c:174</a></div></div>
<div class="ttc" id="crypto_8h_html_a5e47576e502b5a6255f1b489a4915512"><div class="ttname"><a href="crypto_8h.html#a5e47576e502b5a6255f1b489a4915512">dtls_prf</a></div><div class="ttdeci">size_t dtls_prf(const unsigned char *key, size_t keylen, const unsigned char *label, size_t labellen, const unsigned char *random1, size_t random1len, const unsigned char *random2, size_t random2len, unsigned char *buf, size_t buflen)</div><div class="ttdef"><b>Definition:</b> <a href="crypto_8c_source.html#l00249">crypto.c:249</a></div></div>
<div class="ttc" id="structaes128__ccm__t_html_a5bdf410f025e4177ced456059bc8a371"><div class="ttname"><a href="structaes128__ccm__t.html#a5bdf410f025e4177ced456059bc8a371">aes128_ccm_t::ctx</a></div><div class="ttdeci">rijndael_ctx ctx</div><div class="ttdef"><b>Definition:</b> <a href="crypto_8h_source.html#l00071">crypto.h:71</a></div></div>
<div class="ttc" id="t__list_8h_html"><div class="ttname"><a href="t__list_8h.html">t_list.h</a></div><div class="ttdoc">Wrappers for list structures and functions. </div></div>
<div class="ttc" id="structdtls__handshake__parameters__t_html_a5cc61a98763800b5b4e7617307649933"><div class="ttname"><a href="structdtls__handshake__parameters__t.html#a5cc61a98763800b5b4e7617307649933">dtls_handshake_parameters_t::cipher</a></div><div class="ttdeci">dtls_cipher_t cipher</div><div class="ttdef"><b>Definition:</b> <a href="crypto_8h_source.html#l00128">crypto.h:128</a></div></div>
<div class="ttc" id="crypto_8h_html_a3710d42871d602387a5147c05bf9f1efa517a66bf6725327c3240add3537f34ff"><div class="ttname"><a href="crypto_8h.html#a3710d42871d602387a5147c05bf9f1efa517a66bf6725327c3240add3537f34ff">DTLS_ECDH_CURVE_SECP256R1</a></div><div class="ttdef"><b>Definition:</b> <a href="crypto_8h_source.html#l00066">crypto.h:66</a></div></div>
<div class="ttc" id="global_8h_html_a1ff555e0b1443c4cb4d17ac2161d89b2"><div class="ttname"><a href="global_8h.html#a1ff555e0b1443c4cb4d17ac2161d89b2">dtls_compression_t</a></div><div class="ttdeci">dtls_compression_t</div><div class="ttdef"><b>Definition:</b> <a href="global_8h_source.html#l00081">global.h:81</a></div></div>
<div class="ttc" id="crypto_8h_html_a288c4ec1a5110ab3f44ab3cb7c289e69"><div class="ttname"><a href="crypto_8h.html#a288c4ec1a5110ab3f44ab3cb7c289e69">dtls_encrypt</a></div><div class="ttdeci">int dtls_encrypt(const unsigned char *src, size_t length, unsigned char *buf, unsigned char *nounce, unsigned char *key, size_t keylen, const unsigned char *aad, size_t aad_length)</div><div class="ttdef"><b>Definition:</b> <a href="crypto_8c_source.html#l00524">crypto.c:524</a></div></div>
<div class="ttc" id="crypto_8h_html_a1423f8111df1533241178461c10b50e3"><div class="ttname"><a href="crypto_8h.html#a1423f8111df1533241178461c10b50e3">dtls_mac</a></div><div class="ttdeci">void dtls_mac(dtls_hmac_context_t *hmac_ctx, const unsigned char *record, const unsigned char *packet, size_t length, unsigned char *buf)</div><div class="ttdef"><b>Definition:</b> <a href="crypto_8c_source.html#l00266">crypto.c:266</a></div></div>
<div class="ttc" id="crypto_8h_html_a25930cdb27a6ffcf05e2c2a9c95a6af8"><div class="ttname"><a href="crypto_8h.html#a25930cdb27a6ffcf05e2c2a9c95a6af8">dtls_handshake_new</a></div><div class="ttdeci">dtls_handshake_parameters_t * dtls_handshake_new()</div><div class="ttdef"><b>Definition:</b> <a href="crypto_8c_source.html#l00123">crypto.c:123</a></div></div>
<div class="ttc" id="crypto_8h_html_aa53dfed4868e257d2485024b5c170bae"><div class="ttname"><a href="crypto_8h.html#aa53dfed4868e257d2485024b5c170bae">dtls_psk_pre_master_secret</a></div><div class="ttdeci">int dtls_psk_pre_master_secret(unsigned char *key, size_t keylen, unsigned char *result, size_t result_len)</div><div class="ttdef"><b>Definition:</b> <a href="crypto_8c_source.html#l00318">crypto.c:318</a></div></div>
<div class="ttc" id="crypto_8h_html_a982fc9e78cd10d9323756b15b72c7970"><div class="ttname"><a href="crypto_8h.html#a982fc9e78cd10d9323756b15b72c7970">dtls_ecdsa_generate_key</a></div><div class="ttdeci">void dtls_ecdsa_generate_key(unsigned char *priv_key, unsigned char *pub_key_x, unsigned char *pub_key_y, size_t key_size)</div><div class="ttdef"><b>Definition:</b> <a href="crypto_8c_source.html#l00425">crypto.c:425</a></div></div>
<div class="ttc" id="crypto_8h_html_a3a99a8753c2eb9baf1e03fe0ffbb813b"><div class="ttname"><a href="crypto_8h.html#a3a99a8753c2eb9baf1e03fe0ffbb813b">dtls_decrypt</a></div><div class="ttdeci">int dtls_decrypt(const unsigned char *src, size_t length, unsigned char *buf, unsigned char *nounce, unsigned char *key, size_t keylen, const unsigned char *a_data, size_t a_data_length)</div><div class="ttdef"><b>Definition:</b> <a href="crypto_8c_source.html#l00550">crypto.c:550</a></div></div>
<div class="ttc" id="structdtls__cipher__context__t_html_a02da63201e2ac7bc508e3bb54c5761dc"><div class="ttname"><a href="structdtls__cipher__context__t.html#a02da63201e2ac7bc508e3bb54c5761dc">dtls_cipher_context_t::data</a></div><div class="ttdeci">aes128_ccm_t data</div><div class="ttdef"><b>Definition:</b> <a href="crypto_8h_source.html#l00076">crypto.h:76</a></div></div>
<div class="ttc" id="global_8h_html"><div class="ttname"><a href="global_8h.html">global.h</a></div></div>
<div class="ttc" id="crypto_8h_html_aea7bd0a10cf289c033216a97c0ee701e"><div class="ttname"><a href="crypto_8h.html#aea7bd0a10cf289c033216a97c0ee701e">dtls_p_hash</a></div><div class="ttdeci">size_t dtls_p_hash(dtls_hashfunc_t h, const unsigned char *key, size_t keylen, const unsigned char *label, size_t labellen, const unsigned char *random1, size_t random1len, const unsigned char *random2, size_t random2len, unsigned char *buf, size_t buflen)</div><div class="ttdef"><b>Definition:</b> <a href="crypto_8c_source.html#l00183">crypto.c:183</a></div></div>
<div class="ttc" id="structdtls__handshake__parameters__ecdsa__t_html"><div class="ttname"><a href="structdtls__handshake__parameters__ecdsa__t.html">dtls_handshake_parameters_ecdsa_t</a></div><div class="ttdef"><b>Definition:</b> <a href="crypto_8h_source.html#l00079">crypto.h:79</a></div></div>
<div class="ttc" id="crypto_8h_html_ab96c8e0773a14d1ce1621eed1a78e2bd"><div class="ttname"><a href="crypto_8h.html#ab96c8e0773a14d1ce1621eed1a78e2bd">DTLS_PSK_MAX_CLIENT_IDENTITY_LEN</a></div><div class="ttdeci">#define DTLS_PSK_MAX_CLIENT_IDENTITY_LEN</div><div class="ttdef"><b>Definition:</b> <a href="crypto_8h_source.html#l00089">crypto.h:89</a></div></div>
<div class="ttc" id="crypto_8h_html_a0df6db4f8c29f2b0aa5a1363b4f9127f"><div class="ttname"><a href="crypto_8h.html#a0df6db4f8c29f2b0aa5a1363b4f9127f">MAX_KEYBLOCK_LENGTH</a></div><div class="ttdeci">#define MAX_KEYBLOCK_LENGTH</div><div class="ttdef"><b>Definition:</b> <a href="crypto_8h_source.html#l00055">crypto.h:55</a></div></div>
<div class="ttc" id="hmac_8h_html"><div class="ttname"><a href="hmac_8h.html">hmac.h</a></div></div>
<div class="ttc" id="structdtls__handshake__parameters__psk__t_html_a39ae0d1ead76e8bd5a3631ae8677be1b"><div class="ttname"><a href="structdtls__handshake__parameters__psk__t.html#a39ae0d1ead76e8bd5a3631ae8677be1b">dtls_handshake_parameters_psk_t::id_length</a></div><div class="ttdeci">uint16_t id_length</div><div class="ttdef"><b>Definition:</b> <a href="crypto_8h_source.html#l00095">crypto.h:95</a></div></div>
<div class="ttc" id="crypto_8h_html_aa17bcdc666796e52788f82ee003bb172"><div class="ttname"><a href="crypto_8h.html#aa17bcdc666796e52788f82ee003bb172">dtls_handshake_free</a></div><div class="ttdeci">void dtls_handshake_free(dtls_handshake_parameters_t *handshake)</div><div class="ttdef"><b>Definition:</b> <a href="crypto_8c_source.html#l00146">crypto.c:146</a></div></div>
<div class="ttc" id="crypto_8h_html_a5a0bdff7c0889f35601b4935098508a0"><div class="ttname"><a href="crypto_8h.html#a5a0bdff7c0889f35601b4935098508a0">DTLS_RANDOM_LENGTH</a></div><div class="ttdeci">#define DTLS_RANDOM_LENGTH</div><div class="ttdef"><b>Definition:</b> <a href="crypto_8h_source.html#l00060">crypto.h:60</a></div></div>
<div class="ttc" id="structdtls__handshake__parameters__psk__t_html"><div class="ttname"><a href="structdtls__handshake__parameters__psk__t.html">dtls_handshake_parameters_psk_t</a></div><div class="ttdef"><b>Definition:</b> <a href="crypto_8h_source.html#l00094">crypto.h:94</a></div></div>
<div class="ttc" id="structdtls__hmac__context__t_html"><div class="ttname"><a href="structdtls__hmac__context__t.html">dtls_hmac_context_t</a></div><div class="ttdef"><b>Definition:</b> <a href="hmac_8h_source.html#l00095">hmac.h:95</a></div></div>
<div class="ttc" id="crypto_8h_html_a3710d42871d602387a5147c05bf9f1ef"><div class="ttname"><a href="crypto_8h.html#a3710d42871d602387a5147c05bf9f1ef">dtls_ecdh_curve</a></div><div class="ttdeci">dtls_ecdh_curve</div><div class="ttdef"><b>Definition:</b> <a href="crypto_8h_source.html#l00065">crypto.h:65</a></div></div>
<div class="ttc" id="global_8h_html_adde6aaee8457bee49c2a92621fe22b79"><div class="ttname"><a href="global_8h.html#adde6aaee8457bee49c2a92621fe22b79">uint8</a></div><div class="ttdeci">unsigned char uint8</div><div class="ttdef"><b>Definition:</b> <a href="global_8h_source.html#l00047">global.h:47</a></div></div>
<div class="ttc" id="structdtls__handshake__parameters__t_html_a67f85371953c8ae07ec110cb39c13125"><div class="ttname"><a href="structdtls__handshake__parameters__t.html#a67f85371953c8ae07ec110cb39c13125">dtls_handshake_parameters_t::compression</a></div><div class="ttdeci">dtls_compression_t compression</div><div class="ttdef"><b>Definition:</b> <a href="crypto_8h_source.html#l00127">crypto.h:127</a></div></div>
<div class="ttc" id="structdtls__security__parameters__t_html_a100dc82ee41004df1d9f211873332f87"><div class="ttname"><a href="structdtls__security__parameters__t.html#a100dc82ee41004df1d9f211873332f87">dtls_security_parameters_t::rseq</a></div><div class="ttdeci">uint64_t rseq</div><div class="ttdef"><b>Definition:</b> <a href="crypto_8h_source.html#l00104">crypto.h:104</a></div></div>
<div class="ttc" id="structdtls__security__parameters__t_html_a6a72df7ab1151f81e49d464175fcaf2a"><div class="ttname"><a href="structdtls__security__parameters__t.html#a6a72df7ab1151f81e49d464175fcaf2a">dtls_security_parameters_t::compression</a></div><div class="ttdeci">dtls_compression_t compression</div><div class="ttdef"><b>Definition:</b> <a href="crypto_8h_source.html#l00100">crypto.h:100</a></div></div>
<div class="ttc" id="structdtls__security__parameters__t_html_a21d9fac709d739535b0cbecce4c18830"><div class="ttname"><a href="structdtls__security__parameters__t.html#a21d9fac709d739535b0cbecce4c18830">dtls_security_parameters_t::cipher</a></div><div class="ttdeci">dtls_cipher_t cipher</div><div class="ttdef"><b>Definition:</b> <a href="crypto_8h_source.html#l00102">crypto.h:102</a></div></div>
<div class="ttc" id="crypto_8h_html_a2648582ddf4c82abc01d8388bd3f15db"><div class="ttname"><a href="crypto_8h.html#a2648582ddf4c82abc01d8388bd3f15db">DTLS_MASTER_SECRET_LENGTH</a></div><div class="ttdeci">#define DTLS_MASTER_SECRET_LENGTH</div><div class="ttdef"><b>Definition:</b> <a href="crypto_8h_source.html#l00059">crypto.h:59</a></div></div>
<div class="ttc" id="crypto_8h_html_afa2d9b2a195a1d8e8c56b1af8cb7bc82"><div class="ttname"><a href="crypto_8h.html#afa2d9b2a195a1d8e8c56b1af8cb7bc82">dtls_ecdsa_create_sig</a></div><div class="ttdeci">void dtls_ecdsa_create_sig(const unsigned char *priv_key, size_t key_size, const unsigned char *client_random, size_t client_random_size, const unsigned char *server_random, size_t server_random_size, const unsigned char *keyx_params, size_t keyx_params_size, uint32_t point_r[9], uint32_t point_s[9])</div><div class="ttdef"><b>Definition:</b> <a href="crypto_8c_source.html#l00463">crypto.c:463</a></div></div>
<div class="ttc" id="crypto_8h_html_a802b3a2b267747a76d4557c6c9a899d7"><div class="ttname"><a href="crypto_8h.html#a802b3a2b267747a76d4557c6c9a899d7">dtls_ecdsa_verify_sig_hash</a></div><div class="ttdeci">int dtls_ecdsa_verify_sig_hash(const unsigned char *pub_key_x, const unsigned char *pub_key_y, size_t key_size, const unsigned char *sign_hash, size_t sign_hash_size, unsigned char *result_r, unsigned char *result_s)</div><div class="ttdef"><b>Definition:</b> <a href="crypto_8c_source.html#l00483">crypto.c:483</a></div></div>
<div class="ttc" id="state_8h_html"><div class="ttname"><a href="state_8h.html">state.h</a></div><div class="ttdoc">state information for DTLS FSM </div></div>
<div class="ttc" id="crypto_8h_html_a5ae24f3621f545752732e318840d7e2b"><div class="ttname"><a href="crypto_8h.html#a5ae24f3621f545752732e318840d7e2b">dtls_ec_key_from_uint32_asn1</a></div><div class="ttdeci">int dtls_ec_key_from_uint32_asn1(const uint32_t *key, size_t key_size, unsigned char *buf)</div><div class="ttdef"><b>Definition:</b> <a href="crypto_8c_source.html#l00362">crypto.c:362</a></div></div>
<div class="ttc" id="t__list_8h_html_ab5acb500a887e1957292f3dddc5c9b79"><div class="ttname"><a href="t__list_8h.html#ab5acb500a887e1957292f3dddc5c9b79">LIST_STRUCT</a></div><div class="ttdeci">#define LIST_STRUCT(name)</div><div class="ttdef"><b>Definition:</b> <a href="t__list_8h_source.html#l00086">t_list.h:86</a></div></div>
<div class="ttc" id="group__HMAC_html_ga698cfa036e69361a93dcdd9b19579b23"><div class="ttname"><a href="group__HMAC.html#ga698cfa036e69361a93dcdd9b19579b23">dtls_hashfunc_t</a></div><div class="ttdeci">dtls_hashfunc_t</div><div class="ttdef"><b>Definition:</b> <a href="hmac_8h_source.html#l00083">hmac.h:83</a></div></div>
<div class="ttc" id="global_8h_html_ada7e71454d685b693df45b2c1ea0c59b"><div class="ttname"><a href="global_8h.html#ada7e71454d685b693df45b2c1ea0c59b">dtls_cipher_t</a></div><div class="ttdeci">dtls_cipher_t</div><div class="ttdef"><b>Definition:</b> <a href="global_8h_source.html#l00074">global.h:74</a></div></div>
<div class="ttc" id="structdtls__hs__state__t_html"><div class="ttname"><a href="structdtls__hs__state__t.html">dtls_hs_state_t</a></div><div class="ttdef"><b>Definition:</b> <a href="state_8h_source.html#l00054">state.h:54</a></div></div>
<div class="ttc" id="crypto_8h_html_a41f1aa1e1380c5f51d9af32c0a53f7b1a1832208b0a725185016b59150ff74fc4"><div class="ttname"><a href="crypto_8h.html#a41f1aa1e1380c5f51d9af32c0a53f7b1a1832208b0a725185016b59150ff74fc4">AES128</a></div><div class="ttdef"><b>Definition:</b> <a href="crypto_8h_source.html#l00062">crypto.h:62</a></div></div>
<div class="ttc" id="crypto_8h_html_a41f1aa1e1380c5f51d9af32c0a53f7b1"><div class="ttname"><a href="crypto_8h.html#a41f1aa1e1380c5f51d9af32c0a53f7b1">dtls_crypto_alg</a></div><div class="ttdeci">dtls_crypto_alg</div><div class="ttdef"><b>Definition:</b> <a href="crypto_8h_source.html#l00062">crypto.h:62</a></div></div>
<div class="ttc" id="crypto_8h_html_a1d568085636a04b4706b7e50df802a7b"><div class="ttname"><a href="crypto_8h.html#a1d568085636a04b4706b7e50df802a7b">dtls_security_new</a></div><div class="ttdeci">dtls_security_parameters_t * dtls_security_new()</div><div class="ttdef"><b>Definition:</b> <a href="crypto_8c_source.html#l00155">crypto.c:155</a></div></div>
<div class="ttc" id="numeric_8h_html"><div class="ttname"><a href="numeric_8h.html">numeric.h</a></div></div>
<div class="ttc" id="structdtls__cipher__context__t_html"><div class="ttname"><a href="structdtls__cipher__context__t.html">dtls_cipher_context_t</a></div><div class="ttdef"><b>Definition:</b> <a href="crypto_8h_source.html#l00074">crypto.h:74</a></div></div>
<div class="ttc" id="structdtls__security__parameters__t_html"><div class="ttname"><a href="structdtls__security__parameters__t.html">dtls_security_parameters_t</a></div><div class="ttdef"><b>Definition:</b> <a href="crypto_8h_source.html#l00099">crypto.h:99</a></div></div>
<div class="ttc" id="structdtls__security__parameters__t_html_a2bce1fa0bf77eeab8fadca824de602da"><div class="ttname"><a href="structdtls__security__parameters__t.html#a2bce1fa0bf77eeab8fadca824de602da">dtls_security_parameters_t::epoch</a></div><div class="ttdeci">uint16_t epoch</div><div class="ttdef"><b>Definition:</b> <a href="crypto_8h_source.html#l00103">crypto.h:103</a></div></div>
<div class="ttc" id="crypto_8h_html_a86e6ce9d4b4afcef355836955697f52c"><div class="ttname"><a href="crypto_8h.html#a86e6ce9d4b4afcef355836955697f52c">crypto_init</a></div><div class="ttdeci">void crypto_init()</div><div class="ttdef"><b>Definition:</b> <a href="crypto_8c_source.html#l00076">crypto.c:76</a></div></div>
<div class="ttc" id="structdtls__handshake__parameters__t_html"><div class="ttname"><a href="structdtls__handshake__parameters__t.html">dtls_handshake_parameters_t</a></div><div class="ttdef"><b>Definition:</b> <a href="crypto_8h_source.html#l00115">crypto.h:115</a></div></div>
<div class="ttc" id="crypto_8h_html_a99482a87021e817524d15c33e89e309c"><div class="ttname"><a href="crypto_8h.html#a99482a87021e817524d15c33e89e309c">dtls_cipher_context_t</a></div><div class="ttdeci">struct dtls_cipher_context_t dtls_cipher_context_t</div></div>
<div class="ttc" id="crypto_8h_html_a035860da45ba2586a95c8ef7f539a3c9"><div class="ttname"><a href="crypto_8h.html#a035860da45ba2586a95c8ef7f539a3c9">dtls_ecdsa_verify_sig</a></div><div class="ttdeci">int dtls_ecdsa_verify_sig(const unsigned char *pub_key_x, const unsigned char *pub_key_y, size_t key_size, const unsigned char *client_random, size_t client_random_size, const unsigned char *server_random, size_t server_random_size, const unsigned char *keyx_params, size_t keyx_params_size, unsigned char *result_r, unsigned char *result_s)</div><div class="ttdef"><b>Definition:</b> <a href="crypto_8c_source.html#l00503">crypto.c:503</a></div></div>
<div class="ttc" id="ccm_8h_html"><div class="ttname"><a href="ccm_8h.html">ccm.h</a></div></div>
<div class="ttc" id="crypto_8h_html_a49f03039780664684d110d83a228b163"><div class="ttname"><a href="crypto_8h.html#a49f03039780664684d110d83a228b163">dtls_ecdsa_create_sig_hash</a></div><div class="ttdeci">void dtls_ecdsa_create_sig_hash(const unsigned char *priv_key, size_t key_size, const unsigned char *sign_hash, size_t sign_hash_size, uint32_t point_r[9], uint32_t point_s[9])</div><div class="ttdef"><b>Definition:</b> <a href="crypto_8c_source.html#l00446">crypto.c:446</a></div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Fri Feb 27 2015 15:15:33 for tinydtls by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.6
</small></address>
</body>
</html>
